package com.Modular.pdf_Util.examplesPDF.CheLiangAnQuanSheShiJianCha;

import com.jfinal.core.Controller;
import com.jfinal.kit.Kv;

/**
 * 车辆安全设施检查
 */
public class CheLiangAnQuanSheShiJianChaControlle extends Controller {

    public void buildPdf() {
        String SYS_DanWeiDaiMa = getPara("SYS_DanWeiDaiMa");//单位代码
        String startTime = getPara("startTime");//开始时间   非必须 默认为一周前
        String endTime = getPara("endTime");//结束时间   //非必须默认为当天
        try {
            String buildUrl = CheLiangAnQuanSheShiJianChaService.service.buildPdf(SYS_DanWeiDaiMa, startTime, endTime);

            Kv dataMap = Kv.create().set("WenJianURL", buildUrl);

            renderJson(Kv.create().set("code", 200).set("data", dataMap).set("msg", "成功"));
        } catch (Exception e) {
            renderJson(Kv.create().set("code", 500).set("data", e).set("msg", "生成pdf出错"));
        }
    }
}
